package cn.edu.xmu.oomall.wechatpay.mapper.generator;

import cn.edu.xmu.oomall.wechatpay.mapper.generator.po.DivReceiverPo;
import cn.edu.xmu.oomall.wechatpay.mapper.generator.po.DivReceiverPoExample;
import java.util.List;
import org.apache.ibatis.annotations.Delete;
import org.apache.ibatis.annotations.Insert;
import org.apache.ibatis.annotations.InsertProvider;
import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.Result;
import org.apache.ibatis.annotations.Results;
import org.apache.ibatis.annotations.Select;
import org.apache.ibatis.annotations.SelectKey;
import org.apache.ibatis.annotations.SelectProvider;
import org.apache.ibatis.annotations.Update;
import org.apache.ibatis.annotations.UpdateProvider;
import org.apache.ibatis.type.JdbcType;

public interface DivReceiverPoMapper {
    /**
     * This method was generated by MyBatis Generator.
     * This method corresponds to the database table wechatpay_div_receiver
     *
     * @mbg.generated
     */
    @Delete({
        "delete from wechatpay_div_receiver",
        "where `id` = #{id,jdbcType=BIGINT}"
    })
    int deleteByPrimaryKey(Long id);

    /**
     * This method was generated by MyBatis Generator.
     * This method corresponds to the database table wechatpay_div_receiver
     *
     * @mbg.generated
     */
    @Insert({
        "insert into wechatpay_div_receiver (`id`, `amount`, ",
        "`description`, `order_id`, ",
        "`type`, `account`, `result`, ",
        "`fail_reason`, `create_time`, ",
        "`finish_time`)",
        "values (#{id,jdbcType=BIGINT}, #{amount,jdbcType=INTEGER}, ",
        "#{description,jdbcType=VARCHAR}, #{orderId,jdbcType=VARCHAR}, ",
        "#{type,jdbcType=VARCHAR}, #{account,jdbcType=VARCHAR}, #{result,jdbcType=VARCHAR}, ",
        "#{failReason,jdbcType=VARCHAR}, #{createTime,jdbcType=TIMESTAMP}, ",
        "#{finishTime,jdbcType=TIMESTAMP})"
    })
    @SelectKey(statement="SELECT LAST_INSERT_ID()", keyProperty="detailId", before=false, resultType=String.class)
    int insert(DivReceiverPo row);

    /**
     * This method was generated by MyBatis Generator.
     * This method corresponds to the database table wechatpay_div_receiver
     *
     * @mbg.generated
     */
    @InsertProvider(type=DivReceiverPoSqlProvider.class, method="insertSelective")
    @SelectKey(statement="SELECT LAST_INSERT_ID()", keyProperty="detailId", before=false, resultType=String.class)
    int insertSelective(DivReceiverPo row);

    /**
     * This method was generated by MyBatis Generator.
     * This method corresponds to the database table wechatpay_div_receiver
     *
     * @mbg.generated
     */
    @SelectProvider(type=DivReceiverPoSqlProvider.class, method="selectByExample")
    @Results({
        @Result(column="id", property="id", jdbcType=JdbcType.BIGINT, id=true),
        @Result(column="amount", property="amount", jdbcType=JdbcType.INTEGER),
        @Result(column="description", property="description", jdbcType=JdbcType.VARCHAR),
        @Result(column="order_id", property="orderId", jdbcType=JdbcType.VARCHAR),
        @Result(column="type", property="type", jdbcType=JdbcType.VARCHAR),
        @Result(column="account", property="account", jdbcType=JdbcType.VARCHAR),
        @Result(column="result", property="result", jdbcType=JdbcType.VARCHAR),
        @Result(column="fail_reason", property="failReason", jdbcType=JdbcType.VARCHAR),
        @Result(column="create_time", property="createTime", jdbcType=JdbcType.TIMESTAMP),
        @Result(column="finish_time", property="finishTime", jdbcType=JdbcType.TIMESTAMP),
        @Result(column="detail_id", property="detailId", jdbcType=JdbcType.VARCHAR)
    })
    List<DivReceiverPo> selectByExample(DivReceiverPoExample example);

    /**
     * This method was generated by MyBatis Generator.
     * This method corresponds to the database table wechatpay_div_receiver
     *
     * @mbg.generated
     */
    @Select({
        "select",
        "`id`, `amount`, `description`, `order_id`, `type`, `account`, `result`, `fail_reason`, ",
        "`create_time`, `finish_time`, `detail_id`",
        "from wechatpay_div_receiver",
        "where `id` = #{id,jdbcType=BIGINT}"
    })
    @Results({
        @Result(column="id", property="id", jdbcType=JdbcType.BIGINT, id=true),
        @Result(column="amount", property="amount", jdbcType=JdbcType.INTEGER),
        @Result(column="description", property="description", jdbcType=JdbcType.VARCHAR),
        @Result(column="order_id", property="orderId", jdbcType=JdbcType.VARCHAR),
        @Result(column="type", property="type", jdbcType=JdbcType.VARCHAR),
        @Result(column="account", property="account", jdbcType=JdbcType.VARCHAR),
        @Result(column="result", property="result", jdbcType=JdbcType.VARCHAR),
        @Result(column="fail_reason", property="failReason", jdbcType=JdbcType.VARCHAR),
        @Result(column="create_time", property="createTime", jdbcType=JdbcType.TIMESTAMP),
        @Result(column="finish_time", property="finishTime", jdbcType=JdbcType.TIMESTAMP),
        @Result(column="detail_id", property="detailId", jdbcType=JdbcType.VARCHAR)
    })
    DivReceiverPo selectByPrimaryKey(Long id);

    /**
     * This method was generated by MyBatis Generator.
     * This method corresponds to the database table wechatpay_div_receiver
     *
     * @mbg.generated
     */
    @UpdateProvider(type=DivReceiverPoSqlProvider.class, method="updateByExampleSelective")
    int updateByExampleSelective(@Param("row") DivReceiverPo row, @Param("example") DivReceiverPoExample example);

    /**
     * This method was generated by MyBatis Generator.
     * This method corresponds to the database table wechatpay_div_receiver
     *
     * @mbg.generated
     */
    @UpdateProvider(type=DivReceiverPoSqlProvider.class, method="updateByExample")
    int updateByExample(@Param("row") DivReceiverPo row, @Param("example") DivReceiverPoExample example);

    /**
     * This method was generated by MyBatis Generator.
     * This method corresponds to the database table wechatpay_div_receiver
     *
     * @mbg.generated
     */
    @UpdateProvider(type=DivReceiverPoSqlProvider.class, method="updateByPrimaryKeySelective")
    int updateByPrimaryKeySelective(DivReceiverPo row);

    /**
     * This method was generated by MyBatis Generator.
     * This method corresponds to the database table wechatpay_div_receiver
     *
     * @mbg.generated
     */
    @Update({
        "update wechatpay_div_receiver",
        "set `amount` = #{amount,jdbcType=INTEGER},",
          "`description` = #{description,jdbcType=VARCHAR},",
          "`order_id` = #{orderId,jdbcType=VARCHAR},",
          "`type` = #{type,jdbcType=VARCHAR},",
          "`account` = #{account,jdbcType=VARCHAR},",
          "`result` = #{result,jdbcType=VARCHAR},",
          "`fail_reason` = #{failReason,jdbcType=VARCHAR},",
          "`create_time` = #{createTime,jdbcType=TIMESTAMP},",
          "`finish_time` = #{finishTime,jdbcType=TIMESTAMP},",
          "`detail_id` = #{detailId,jdbcType=VARCHAR}",
        "where `id` = #{id,jdbcType=BIGINT}"
    })
    int updateByPrimaryKey(DivReceiverPo row);
}